home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gekikoh Dennoh Club 1
/
Gekikoh Dennoh Club Vol. 1 (Japan).7z
/
Gekikoh Dennoh Club Vol. 1 (Japan) (Track 1).bin
/
kowin
/
archive
/
sys
/
kowin14d.lzh
/
smpl
/
mtmlib
/
neko.c
< prev
Wrap
C/C++ Source or Header
|
1995-02-11
|
794b
|
46 lines
/* MiniTERM v2 smpl */
#include <mtm_stdio.h>
#include <time.h>
#define MTA_WINDOW_TITLE "neko_term"
#define MTA_WINDOW_SIZEX 40
#define MTA_WINDOW_SIZEY 15
#include "mtm_conf.c"
#define K1(a) ((a)>>8)
#define K2(a) ((a)&255)
#define KSET(a,b) (*(a)++=K1(b),*(a)++=K2(b))
static unsigned char *
neko( ptr )
unsigned char *ptr;
{
static unsigned char buf[256];
unsigned char *top= ptr, *str= buf;
for(; *ptr ; ptr++ ){
if( *ptr == K1('な') && ptr[1] == K2('な') &&
KanjiTestCode( top, ptr-top+1 ) == 1 ){
KSET( str, 'に' );
KSET( str, 'ゃ' );
ptr++;
}else
*str++= *ptr;
}
strcpy( str, "にゃん" );
return buf;
}
main()
{
char buf[256];
for(;;){
putchar( '>' );
gets( buf );
puts( neko( buf ) );
}
}